<template>
  <div class="app-container" v-loading="loading">
    <el-descriptions :column="2" title="企业信息">
      <el-descriptions-item :span="3" label="营业执照">
        <ImageUpload :disabled="true" :limit="1" :isShowTip="false" v-model="oldData.businessLicensePath"></ImageUpload>
      </el-descriptions-item>
      <el-descriptions-item :span="2" label="签约状态">
        <el-tag v-if="oldData.authenticationStatus === 1">已签约</el-tag>
        <el-tag v-else-if="oldData.authenticationStatus === 0" type="warning">未签约</el-tag>
      </el-descriptions-item>
      <el-descriptions-item :span="2" label="企业名称">
        {{oldData.companyName}}
      </el-descriptions-item>

      <el-descriptions-item label="统一社会信用代码">
        {{oldData.creditCode}}
      </el-descriptions-item>
      <el-descriptions-item label="营业执照有效期">
        {{oldData.licenseValidFrom}} - {{oldData.licenseValidTo}}
      </el-descriptions-item>

      <el-descriptions-item :span="2" label="经营地址">
        {{oldData.operateAddress}}
      </el-descriptions-item>
      <el-descriptions-item :span="2" label="业务简介">
        {{oldData.companyProfile}}
      </el-descriptions-item>
      <el-descriptions-item :span="2" label="公司内部照">
        <ImageUpload :limit="5" :disabled="true" :isShowTip="false" v-model="oldData.storefrontPhotoPath"></ImageUpload>
      </el-descriptions-item>
    </el-descriptions>

    <el-descriptions :column="2" title="法人信息">
      <el-descriptions-item :span="2" label="身份证">
        <ImageUpload :disabled="true" :limit="1" :isShowTip="false" v-model="oldData.legalRepresentativeIdFront"></ImageUpload>
        <ImageUpload :disabled="true" :limit="1" :isShowTip="false" v-model="oldData.legalRepresentativeIdBack"></ImageUpload>
      </el-descriptions-item>
      <el-descriptions-item label="法人姓名">
        {{oldData.legalRepresentativeName}}
      </el-descriptions-item>
      <el-descriptions-item label="法人手机">
        {{oldData.legalRepresentativePhone}}
      </el-descriptions-item>

      <el-descriptions-item label="法人身份证号">
        {{oldData.legalRepresentativeIdCard}}
      </el-descriptions-item>
      <el-descriptions-item label="身份证有效期">
        {{oldData.legalIdNumberBeginTime}} - {{oldData.legalIdNumberEndTime}}
      </el-descriptions-item>
      <el-descriptions-item :span="2" label="法人身份证地址">
        {{oldData.legalRepresentativeAddress}}
      </el-descriptions-item>
    </el-descriptions>

    <el-descriptions :column="2" title="管理员">
      <el-descriptions-item label="管理员姓名">
        {{oldData.administratorName}}
      </el-descriptions-item>
      <el-descriptions-item label="管理员手机号">
        {{oldData.administratorPhone}}
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>
<script>
import {getOrganizationInfoChange} from "@/api/system/organizationInfoChange";

export default {
  name: "changeInfo",
  props:{
    changeId:{
      type:String,
    },
  },
  data() {
    return{
      loading:false,
      oldData:{

      },
      oldOther:{

      },
      invoiceTypeList:[],
    }
  },

  methods:{
    getDetail(){
      this.loading = true
      getOrganizationInfoChange(this.changeId).then(res=>{
        this.loading = false
        this.oldData = JSON.parse(res.data.oldData)
        this.oldOther = JSON.parse(res.data.oldOther)
      }).catch(()=>{
        this.loading = false
      })
    },
  },
  watch:{
    changeId:{
      handler(val){
        if (val){
          this.getDetail()
        }
      },
      immediate:true
    }
  }
}
</script>
<style scoped lang="scss">
::v-deep .el-descriptions{
  margin-top: 20px;
  .el-descriptions__header{
    margin-bottom: 10px;
  }
}
</style>
